package com.fzkj.shejimoshi.factory.abstractfactory.phonefactory;

import com.fzkj.shejimoshi.factory.abstractfactory.phone.Phone;

/**
 * @DESCRIPTION: TODO 手机工厂具体实现
 * @AUTHOR: AnotherOne
 * @DATE: 2021/8/12 15:11
 */
public class PhoneFactory extends AbstractPhoneFactory {

    @Override
    public Phone newPhone(Class<? extends Phone> clazz) {
        Phone phone = null;
        try {
            phone = (Phone) Class.forName(clazz.getName()).newInstance();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return phone;
    }
}
